﻿using System;
using System.Globalization;
using System.Windows.Data;

namespace Demo.Converters
{
    public class NotBoolean : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value is Boolean)
            {
                return !((Boolean)value);
            }
            return null;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value is Boolean)
            {
                return !((Boolean)value);
            }
            return null;
        }
    }
}
